package com.prs.crm.dao.sys.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.sys.CompanyMottoDao;
import com.prs.crm.domain.sys.CompanyMotto;

public class CompanyMottoDaoImpl extends BaseDaoImpl<CompanyMotto>	implements CompanyMottoDao{
	/**
	 * 通过编码查询
	 * @code
	 *
	 */
	
	public CompanyMotto getCompany(final String code) {
			Criteria criteria=this.getSession().createCriteria(CompanyMotto.class);
			criteria.add(Restrictions.eq("type", code));
			List alt=criteria.list();
			if(alt==null||alt.size()==0)
			{
				return null;
			}
			return (CompanyMotto) criteria.list().get(0);
	}

}
